Skip to content

feat(api): publish an OpenAPI document under a versioned API base - #1107

Open
rubenvdlinde wants to merge 1 commit into
developmentfrom
quality/gap-19-openapi
Open

rubenvdlinde wants to merge 1 commit into
developmentfrom
quality/gap-19-openapi

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

Adds an OpenAPI document to launchpad, which had none, and serves it.

  • openapi.json (OpenAPI 3.0.3) at the root: servers with the major version (.../apps/launchpad/api/v1), info.contact, the /openapi.json path, and the API-Version header on every response. It covers the health check and the document itself, and says so in info.description; the other endpoints are not described yet.
  • GET /api/openapi.json (OpenApiController): public, readable from any origin, info.version set to the installed app version; 404 when the file is missing.
  • ApiVersionMiddleware: adds API-Version (the installed app version) to every response of a launchpad /api/ endpoint. SPA pages, public shares and kiosk pages are left alone.
  • Versioned base: every /api/ route is registered a second time under /api/v1/ (same controller method, verb, requirements, defaults; postfix V1 for a unique name). The unversioned routes stay, so existing clients and generated URLs are unchanged. The deep-link catch-all already excludes /api/.
  • StoreWiringTest now keys routes the way Nextcloud registers them (name + postfix), so the /api/v1/ twin does not overwrite the route it checks.

Checks: spectral (spectral:oas) reports nothing at any severity. New unit tests for both classes and a route test that every /api/ route has a /api/v1/ twin with its own name (each seen failing against a broken change). Full unit suite: 2829 tests OK (13 skipped), as on development. phpstan clean and phpcs 0 errors on the changed lib files.


Generated by Claude Code

openapi.json at the root describes the health check and the document
itself, with a versioned server URL, info.contact and the API-Version
header on every response. It is served publicly at /api/openapi.json
with info.version set to the installed app version.

ApiVersionMiddleware adds API-Version (the installed app version) to
every response of a LaunchPad /api/ endpoint. Every /api/ route also
answers under /api/v1/, with its own route name through 'postfix'; the
unversioned routes stay.

Assisted-by: ClaudeCode:claude-opus-5-5
@github-actions

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/launchpad @ fc07432

Check PHP Vue Security License Tests
lint ✅
phpcs ✅
phpmd ❌
psalm ✅
phpstan ✅
phpmetrics ✅
eslint ✅
stylelint ✅
build ✅
check-manifest ✅
format ❌
check-schema-l10n ✅
composer ❌ ✅ 107/107
npm ✅ ✅ 636/636
app:check-code ⏭️
info.xml ✅
REUSE ❌
lockfile sync ✅
PHPUnit ❌ 3112/3113
Newman ✅ 224/224
Playwright ⏭️ deferred: E2E runs locally and on the promotion path only. This pull request targets development, so the suite is asked once per promotion into beta and main rather than once per push per open pull request. Run it locally with npx playwright test, or from the Actions tab on a branch with no open pull request into development.
Hydra gates ❌

Quality workflow — 2026-11-14 16:21 UTC

Download the full PDF report from the workflow artifacts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant